package com.aigou.admin.aigouspringboot.service;

import com.aigou.admin.aigouspringboot.entity.User;
import com.aigou.admin.aigouspringboot.entity.dto.UserQueryDTO;
import com.aigou.admin.aigouspringboot.entity.vo.UserVO;
import com.github.pagehelper.PageInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Author Mr.LiFuXing
 * @Date 2024/12/10 20:20
 * @Title UserService
 * @Package com.aigou.admin.aigouspringboot.service
 */
public interface UserService {

    List<User> selectAll();

    PageInfo<User> selectUserListByPage(Integer current, UserQueryDTO userQueryDTO);

    int deleteById(String id);

    User selectById(String id);

    int edit(User user);

    int save(User user);

    UserVO login(User user, HttpServletRequest httpServletRequest, HttpServletResponse response);

    /**
     * 前台用户注册
     * @param user
     * @return
     */
    int register(User user);

    /**
     * 前台用户登录页
     * @param user
     * @param httpServletRequest
     * @return
     */
    UserVO userLogin(User user, HttpServletRequest httpServletRequest);

    /**
     * 获取当前登录的用户信息
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);
}
